home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / cool / ge_cool.lha / GE_COOL2.1 / man / oldman3 / Binary_Node.3T < prev    next >
Text File  |  1992-06-26  |  3KB  |  101 lines

  1. .TH BINARY_NODE
  2. .SH NAME
  3. Binary_Node<Type>\f1  Parameterized binary node class
  4. .SH SYNOPSIS
  5. #include <cool/Binary_Node.h>
  6. .SH DESCRIPTION
  7. The 
  8.  Binary_Node< Type > 
  9. class implements parameterized nodes for  binary trees. 
  10. This class is privately derived from the 
  11.  Binary_Node 
  12. class that contains left 
  13. and right subtree pointers. The 
  14.  Binary_Node< Type > 
  15. class adds a data member of 
  16. the required type in the private section. Since the 
  17.  Binary_Node< Type > 
  18. class is 
  19. intended for use by the 
  20.  Binary_Tree< Type > 
  21. class, the 
  22.  Binary_Tree< Type > 
  23. class is 
  24. declared a friend class.
  25. .SH Base Classes
  26.  Binary_Node
  27. .SH Friend Classes
  28.  Binary_Tree< Type >
  29. .SH Constructors
  30. .TP
  31. \f3Binary_Node<Type> \f3();\f1
  32. Allocates a binary node with left and right subtree pointers set to 
  33.  
  34.  NULL .
  35. .TP
  36. \f3Binary_Node<Type> (const Binary_Node<Type>& bn\f3);\f1
  37. Duplicates the value of another binary node object
  38.  bn .
  39. .TP
  40. \f3Binary_Node<Type> \f3(const Type& value\f3);\f1
  41. Allocates a binary node with left and right subtree pointers set to 
  42.  
  43.  NULL
  44. and 
  45. initializes the value of the node to
  46.  value .
  47. .SH Member Functions
  48. .TP
  49. \f3Binary_Node<Type>>>&\f3 operator= (const Binary_Node<Type>& bn\f3);\f1
  50. Overloads the assignment operator to assign the values of the left and right 
  51. subtree pointers and to assign the value in 
  52.  bn 
  53. to the binary node object. This 
  54. function returns a reference to the updated node.
  55. .TP
  56.  inline Type& get () const;
  57. Returns a reference to the value of the data member.
  58. .TP
  59. \f3inline Binary_Node<Type>* \f3get_ltree () const;\f1
  60. Returns a pointer to the left subtree.
  61. .TP
  62. \f3inline Binary_Node<Type>* \f3get_rtree () const;\f1
  63. Returns a pointer to the right subtree.
  64. .TP
  65.  inline Boolean is_leaf () const;
  66. Determines if the node is a terminal node by evaluating the left and right 
  67. subtree pointers. If both are 
  68.  
  69.  NULL , 
  70. this function returns 
  71.  
  72.  TRUE ; 
  73. otherwise, this 
  74. function returns 
  75.  
  76.  FALSE .
  77. .TP
  78. \f3inline void set (const Type& value\f3);\f1
  79. Sets the value of the data member in the node to 
  80.  value .
  81. .TP
  82. \f3inline void set_ltree (Binary_Node<Type>* bn\f3);\f1
  83. Sets the value of the left subtree pointer of the binary node object to 
  84.  bn .
  85. .TP
  86. \f3inline void set_rtree (Binary_Node<Type>* bn\f3);\f1
  87. Sets the value of the right subtree pointer of the binary node object to 
  88.  bn .
  89. .SH COPYRIGHT
  90.  
  91. Copyright (C) 1991 Texas Instruments Incorporated.
  92.  
  93. Permission is granted to any individual or institution to use, copy, modify,
  94. and distribute this software, provided that this complete copyright and
  95. permission notice is maintained, intact, in all copies and supporting
  96. documentation.
  97.  
  98. Texas Instruments Incorporated provides this software "as is" without
  99. express or implied warranty.
  100.  
  101.